package caiziyou.com.designpattern.factory.method.order;

import caiziyou.com.designpattern.factory.method.pizza.BJCheesePizza;
import caiziyou.com.designpattern.factory.method.pizza.BJPepperPizza;
import caiziyou.com.designpattern.factory.method.pizza.Pizza;

public class BJOrderPizza extends OrderPizza{

	@Override
	public Pizza createPizza(String orderType) {
		Pizza pizza = null;
		if (orderType.equals("cheese")) {
			pizza = new BJCheesePizza();
			pizza.setName("奶酪披萨");
		}else if (orderType.equals("pepper") ){
			pizza = new BJPepperPizza();
			pizza.setName("胡椒披萨");
		}else {
			
		}
		pizza.prepare();
		pizza.bake();
		pizza.cut();
		pizza.box();
		return pizza;
	}

}
